﻿@model DFYE.Web.Models.channel
@using DFYE.Web.Models;
@{
    ViewBag.Title = "Create";
    Layout = "~/Areas/powerManage/Views/Shared/manage.cshtml";
}

<h2>频道管理</h2>
<script>
    function changeChannelType(event) {
        if (event.options[event.selectedIndex].text == "@ChannelTypeEnum.外部") {

            $("#extUrl").show();
        } else {

            $("#extUrl").hide();
        }
    
    }
</script>
@using (Html.BeginForm())
{
    <fieldset>
        <legend>新建频道</legend>
        <div class="editor-label">
            父频道
        </div>
        <div class="editor-field">
        @Html.DropDownList("parentID", new SelectList(ViewBag.parents, "ID", "name"), "根频道")
        @(Html.CheckBox("able", true))可见
        @(Html.CheckBox("isNull", false))该项无内容
        </div>
        <div class="editor-label">
            模板类型
        </div>
        <div class="editor-field">
            @Html.DropDownList("type", new SelectList(Enum.GetNames(typeof(ChannelTypeEnum))), new { onchange = "changeChannelType(this)" })
            @Html.TextBoxFor(model => model.extUrl,new {style="display:none"})
            @Html.ValidationMessageFor(model => model.type)
        </div>
        <div class="editor-label">
            频道名称
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.name)
            @Html.ValidationMessageFor(model => model.name)
        </div>

        <div class="editor-label">
            模板代码
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.TempleteCode)
            @Html.ValidationMessageFor(model => model.TempleteCode)
            
        </div>
        <div class="editor-label">
            备注(不显示)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.bak)
            @Html.ValidationMessageFor(model => model.bak)
        </div>
    </fieldset>
    
@*    <fieldset>
        <legend>指定权限</legend>
        @Html.Partial("powerBox",Model.power)
    </fieldset> *@
    
         <p>
            <input type="submit" value="创建" name="xxx" />
        </p>   
}

<div>
    @Html.ActionLink("回列表", "Index")
</div>

